<!DOCTYPE html>
<html lang="en">
<head>
	{include file='public/header' /}

	<!-- Data table CSS -->
	<link href="__PUBLIC__/admin/vendors/bower_components/datatables/media/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css"/>

	<!-- Custom CSS -->
	<link href="__PUBLIC__/admin/dist/css/style.css" rel="stylesheet" type="text/css">
</head>

<body>
<!--Preloader-->
<div class="preloader-it">
	<div class="la-anim-1"></div>
</div>
<!--/Preloader-->
<div class="wrapper  theme-5-active pimary-color-blue">

	<!-- Top Menu Items -->
	{include file='public/top_menu' /}
	<!-- /Top Menu Items -->

	<!-- Left Sidebar Menu -->
	{include file='public/sidebar' /}
	<!-- /Left Sidebar Menu -->

	<!-- Main Content -->
	<div class="page-wrapper">
		<div class="container-fluid">

			<!-- Title -->
			<div class="row heading-bg">
				<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
					<h5 class="txt-dark">幻灯片列表</h5>
				</div>
				<!-- Breadcrumb -->
				<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
					<ol class="breadcrumb">
						<li><a href="{:url('admin/index/index')}">系统首页</a></li>
						<li class="active"><span>幻灯片列表</span></li>
					</ol>
				</div>
				<!-- /Breadcrumb -->
			</div>
			<!-- /Title -->

            <div class="row">
                <!-- Basic Table -->
                <div class="col-sm-12">
                    <div class="panel panel-default card-view">
                        <div class="panel-heading">
                            <div class="pull-left">
                                <h6 class="panel-title txt-dark">相关操作</h6>
                            </div>
                            <div class="clearfix"></div>
                        </div>
                        <div class="panel-wrapper collapse in">
                            <div class="panel-body">
                                <a href="{:url('add')}" class="btn btn-success btn-anim"><i class="fa fa-plus"></i><span class="btn-text">添加幻灯片</span></a>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /Basic Table -->
            </div>

			<!-- Row -->
			<div class="row">
				<div class="col-sm-12">
					<div class="panel panel-default card-view">
						<div class="panel-heading">
							<div class="pull-left">
								<h6 class="panel-title txt-dark">幻灯片列表</h6>
							</div>
							<div class="clearfix"></div>
						</div>
						<div class="panel-wrapper collapse in">
							<div class="panel-body">
								<div class="table-wrap">
									<div class="table-responsive">
										<table id="datable_1" class="table table-hover display  pb-30" >
											<thead>
											<tr>
												<th>ID</th>
												<th>缩略图</th>
												<th>标题</th>
												<th>所属分类</th>
												<th>跳转链接</th>
												<th>排序</th>
												<th>状态</th>
                                                <th>更新时间</th>
												<th>操作</th>
											</tr>
											</thead>
											<tbody>
                                            {notempty name='list'}
                                            {foreach name='list' item='value'}
                                            <tr>
                                                <td>{$value.id}</td>
                                                <td>
                                                    {notempty name='value.thumb'}
                                                    <a href="__PUBLIC__/{$value.thumb}" data-toggle="tooltip" data-original-title="查看原图" class="ml-10" target="_blank" style="display: block;">
                                                        <img src="__PUBLIC__/{$value.thumb}" height="100" alt="">
                                                    </a>
                                                    {/notempty}
                                                </td>
                                                <td>{$value.title}</td>
                                                <td>{$value.category_name}</td>
                                                <td>{$value.url}</td>
                                                <td>{$value.sort}</td>
                                                <td>{eq name='value.status' value='1'}<a href="javascript:;" class="mr-20" data-toggle="tooltip" data-original-title="显示"> <i class="fa fa-eye text-inverse m-r-10"></i> </a>{else /}<a href="javascript:;" class="mr-20" data-toggle="tooltip" data-original-title="隐藏"> <i class="fa fa-eye-slash text-inverse m-r-10"></i> </a>{/eq}</td>
                                                <td>{$value.update_time|date='Y-m-d',###}</td>
                                                <td>
                                                    <a href="{:url('edit', ['id'=>$value['id']])}" class="mr-20" data-toggle="tooltip" data-original-title="编辑"> <i class="fa fa-pencil text-inverse m-r-10"></i> </a>
                                                    <a href="javascript:;" data-toggle="tooltip" data-original-title="删除" onclick="banner_del(this, '{$value.id}');"> <i class="fa  fa-trash-o text-danger"></i> </a>
                                                </td>
                                            </tr>
                                            {/foreach}
                                            {/notempty}
											</tbody>
										</table>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<!-- /Row -->
		</div>

		<!-- Footer -->
		{include file='public/footer' /}
		<!-- /Footer -->

	</div>
	<!-- /Main Content -->

</div>
<!-- /#wrapper -->

<!-- JavaScript -->

<!-- jQuery -->
<script src="__PUBLIC__/admin/vendors/bower_components/jquery/dist/jquery.min.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>

<!-- Data table JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/datatables/media/js/jquery.dataTables.min.js"></script>
<script src="__PUBLIC__/admin/dist/js/dataTables-data.js"></script>

<!-- Slimscroll JavaScript -->
<script src="__PUBLIC__/admin/dist/js/jquery.slimscroll.js"></script>

<!-- Owl JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/owl.carousel/dist/owl.carousel.min.js"></script>

<!-- Switchery JavaScript -->
<script src="__PUBLIC__/admin/vendors/bower_components/switchery/dist/switchery.min.js"></script>

<!-- Fancy Dropdown JS -->
<script src="__PUBLIC__/admin/dist/js/dropdown-bootstrap-extended.js"></script>

<!-- Init JavaScript -->
{include file='public/comn_js' /}

<script src="__PUBLIC__/admin/vendors/layer/layer.js"></script>

<script>
    function banner_del(obj, id) {
        layer.confirm('您确定要删除该幻灯片吗？', {
            btn: ['确定', '取消'],
            shade: [0.6, '#000']
        }, function () {
            var index = layer.load(1, {shade: [0.6, '#000']});
            $.post("{:url('del')}", {id:id}, function (data) {
                if (data.status)
                {
                    layer.msg('删除成功！', {shade: [0.6, '#000'], time:3000}, function () {
                        $(obj).parents('td').parents('tr').remove();
                        layer.close(index);
                    });
                } else {
                    layer.msg(data.msg, {shade: [0.6, '#000'], time:3000}, function () {
                        window.location.reload();
                    });
                }
            })
        })
    }
</script>
</body>

</html>
